import { createApp } from 'vue'
import App from './App.vue'
import 'vfonts/Lato.css'
import 'vfonts/FiraCode.css'
import './assets/icon/iconfont.css'
import naive from 'naive-ui'
import 'element-plus/dist/index.css'
import router from "@/router/index";
import { createPinia } from 'pinia'
import {createPersistedState} from "pinia-persistedstate-plugin";
import ElementPlus from 'element-plus'
import './assets/css/main.less'

// rem自适应
function setRemUnit() {
  const docEl = document.documentElement;
  const width = docEl.clientWidth;
  const rem = width*1/88;
  docEl.style.fontSize = rem + 'px';
}
setRemUnit();
window.addEventListener('resize', setRemUnit);



const app = createApp(App)
const pinia = createPinia()
const persist = createPersistedState()
pinia.use(persist)
app.use(naive)
app.use(ElementPlus)
app.use(router)
app.use(pinia)
app.mount('#app')
